package Reflect;

import Reflect.annotation.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo12 {
    public static void main(String[] args) throws Exception {
        Class cla=Class.forName("Reflect.Person");
        Method method=cla.getMethod("sayHello");
        if (method.isAnnotationPresent(AutoRunMethod.class)){
            AutoRunMethod arm=method.getAnnotation(AutoRunMethod.class);
            int value=arm.value();
            System.out.println("注释参数的值为:"+value);
        }
    }
}
